﻿/*
 * @Description:
 * @Author: joe
 * @Date: 2022-01-27 12:55:28
 * @LastEditTime: 2022-03-14 15:38:56
 */
#ifndef     __LV_COMMON_FUNCTION_H__
#define     __LV_COMMON_FUNCTION_H__

#ifdef __cplusplus
extern "C" {
#endif
#include "lvgl/lvgl.h"
#include "lvgl/examples/lv_examples.h"
 
#include <string.h>
#include "stdbool.h"

#include <Windows.h>
 //#define LV_CHART_AXIS_PRIMARY_X     LV_CHART_AXIS_X

 //log on
#define lv_log_on   printf
//log off
//#define lv_log_on

typedef void (*ui_entry)(lv_obj_t* obj);
typedef void (*pri_ui_entry)(lv_obj_t* obj);

extern lv_obj_t* prj_parent_cont;
extern lv_obj_t* prj_prev_cont;
extern lv_group_t* prj_group;
//extern lv_font_t bin_font;
extern uint8_t langurage_mode;



extern const uint8_t* img_26x41_time_arry[11];
extern const uint8_t* img_10x14_number_arry[10];
extern const uint8_t* img_15x21_number_arry[10];
extern const uint8_t* img_12x20_red_number_arry[10];
extern const uint8_t* img_10x14_black_number_arry[10];
extern const uint8_t* img_18x30_number_arry[11];


//extern const uint8_t *week_str_arry[7];
//extern const uint8_t *img_weather_type_arry[10];
extern pri_ui_entry pri_ui_group[];


uint32_t common_pow_function(uint8_t number, uint8_t index);
// void lv_common_showtime(lv_obj_t *parent,lv_img_dsc_t **img_dsc,uint16_t time,uint8_t gap);
// void lv_common_shownumber(lv_obj_t *parent,lv_img_dsc_t **img_dsc,uint32_t number,uint8_t gap);
void lv_common_showtime(lv_obj_t* parent, uint8_t** img_dsc, uint32_t time, uint8_t gap);
void lv_common_shownumber(lv_obj_t* parent, uint8_t** img_dsc, uint32_t number, uint8_t gap);


void layer_add_right_main_cont(lv_obj_t* parent, ui_entry f_cont1);
bool fr_hwd_UI_return_flag(void);




//ui struct

#if 1

typedef enum
{
    UI_MAIN,
    UI_FLOAT_WIN_UP,
    UI_FLOAT_WIN_LEFT,
    UI_FLOAT_WIN_DOWN,
    UI_MENU,
    UI_MAX
}ui_mode_t;


typedef struct
{
    uint8_t ui_page_id;
    uint16_t ui_page_cur_x;
    uint16_t ui_page_cur_y;
}ui_layer_t;






typedef struct
{
    uint8_t ui_mode;			//ui_mode_t

    //lay 1
    ui_layer_t layer1;

    //lay 2
    ui_layer_t layer2;

    //lay 3
    ui_layer_t layer3;

    //lay 4
    ui_layer_t layer4;


    //clock id
    uint8_t ui_clock_id;

    //ui default style
    uint8_t ui_default_style;

    //menu style
    uint8_t ui_menu_style_id;

    //language
    uint8_t ui_language;

    uint8_t ui_backlight_brightness;

    uint8_t ui_lock;

    uint8_t ui_reset;

    uint8_t ui_powerdown;

    uint8_t ui_music_state;

    uint8_t ui_prev_mode;

    uint8_t sos_callnumber[20];


}ui_info_t;



#define  MESSAGE_MAX_LENGTH     200
#define  MAX_MSG_CONTEXT_LEN    MESSAGE_MAX_LENGTH - 17

typedef struct
{
    uint8_t msg_type;
    uint8_t data_len;
    uint8_t msg_time[15];
    //1 byte(title len) + n byte(title) + 1 byte (context leng)+ n byte(context)
    uint8_t msg_context[MAX_MSG_CONTEXT_LEN];

} info_msg_t;

#define MAX_MSG_LIST	5

typedef struct
{
    uint8_t msg_tatol;
    uint8_t fifo_head;
    uint8_t fifo_tail;
    info_msg_t fifo[MAX_MSG_LIST];
} ancs_msg_t;


//ancs 
typedef struct
{
    uint8_t  msg_type;
    uint16_t  title_len;
    uint8_t  msg_title[128];
    uint16_t  context_len;
    uint8_t  msg_context[256];
    uint16_t time_len;
    uint8_t  msg_time[32];
}ancs_t;


typedef enum
{
    CATEGORY_NULL = 0,
    CATEGORY_CALL,			// 1
    CATEGORY_SMS,			// 2
    CATEGORY_OTHER,		// 3
    CATEGORY_Email,			// 4
    CATEGORY_Facebook,		// 5
    CATEGORY_Wechat,		// 6
    CATEGORY_Line,			// 7
    CATEGORY_Weibo,		// 8
    CATEGORY_Linkedlnbo,	// 9
    CATEGORY_QQ,			// 10
    CATEGORY_Whatsapp,		// 11
    CATEGORY_Viber,			// 12
    CATEGORY_Instagram,		// 13
    CATEGORY_KAKAOTALK,	// 14
    CATEGORY_Wirst_Awake,    // 15




    CATEGORY_DINGDING,
    CATEGORY_TWITTER,
    CATEGORY_FACEBOOK,
    CATEGORY_TELEGRAM,
    CATEGORY_MESSENGER,


    CATEGORY_NOT_ENABLE,  // do not support or turn on the switch
}_category_id;


typedef struct
{
    uint8_t  story_state;
    uint8_t  number_len;
    uint8_t  call_namber[32];
    uint8_t  name_len;
    uint8_t  call_name[128];
    uint8_t  time_len;
    uint8_t  msg_time[32];
}call_info_t;


#define pvPortMalloc malloc
#define vPortFree	free



typedef enum
{
    DSP_EVT_NULL = 0,
    DSP_EVT_HEART,				// 1		byte[0] 1��������  byte[1]:0�ر�����	1��������
    DSP_EVT_BLOOD,				// 2		byte[0] 2����Ѫѹ  byte[1]:0�ر�Ѫѹ	1����Ѫѹ
    DSP_EVT_OXYGEN,			// 3		byte[0] 3����Ѫ��  byte[1]:0�ر�Ѫ��	1����Ѫ��
    DSP_EVT_MOTOR,				// 4		byte[0] 4������  byte[1]:0�ر���     1������  byte[2]:�𶯴���
    DSP_EVT_FIND,				// 5		byte[0] 5�����ֻ�  byte[1]:1�����ֻ�

#if 0
    DSP_EVT_MUSIC_PLAY,		// 6		byte[0] 6���ֲ�����ͣ������AVRCP��״̬ get_avrcp_work_state();0:ֹͣ  1:����  2:��ͣ
    DSP_EVT_MUSIC_PAUSE,		// 7		byte[0] 7������ͣ��
    DSP_EVT_MUSIC_STOP,		// 8		byte[0] 8����ֹͣ
    DSP_EVT_MUSIC_FORWARD,	// 9		byte[0] 9��һ��
    DSP_EVT_MUSIC_BACKWARD,	// 10		byte[0] 10��һ��
    DSP_EVT_MUSIC_VALUME_UP,	// 11		byte[0] 11����++
    DSP_EVT_MUSIC_VALUME_DOWN,// 12	byte[0] 12����--

    DSP_EVT_DIAL_NUM,			//13		byte[0] 13����	byte[1......12]���������ź��� ����+13714106071
    DSP_EVT_CALL_ANSWER,		//14		byte[0] 14����
    DSP_EVT_CALL_REJECT,		//15		byte[0] 15�ܽ�
    DSP_EVT_CALL_REDIAL,		//16		byte[0] 16�ز�
    DSP_EVT_CALL_MUTE,			//17		byte[0] 17����	Ŀǰ������Ч�����Ż�
#endif

    DSP_EVT_SYSTEM_SHUTDOWN,	//18		byte[0] 18�ػ�
    DSP_EVT_SYSTEM_RESET,		//19		byte[0] 19��λ
    DSP_EVT_SYSTEM_REBOOT,		//20		byte[0] 20����
    DSP_EVT_WIRST,				//21		byte[0] 21����̧������  byte[1]:0�ر�̧������	1����̧������
    DSP_EVT_LIGHT_TIME,			//22		byte[0] 22��������ʱ��  byte[1]:
    DSP_EVT_BRIGHT,				//23		byte[0] 23�������ȵ���  byte[1]:���ȵȼ�
    DSP_EVT_SYSTEM_LANGUAGE,	//24		byte[0] 24��������         byte[1]:�ο�ö�����Ͷ���
    DSP_EVT_ALARM,				//25		byte[0] 25���ӿ���         byte[1]:
    DSP_EVT_WATCHSTOP_TIME,	//26   	byte[0] 26: �������?       byte[1]:1����  2��ͣ 3�������? 0�ر�	 
    DSP_EVT_SPORTS,				//27		byte[0] 27: �˶�ģʽ����  byte[1]:1��ʼ 2��ͣ 0ֹͣ��������
    DSP_EVT_CAMERA,			//28		byte[0] 28: ����
    DSP_EVT_SWATCH_BRIGHT,	//29		byte[0] 29: ���ر���
    DSP_EVT_ALARM_DELAY,		//30		byte[0] 30: �Ƿ��ӳ�����10���ٴδ���
    DSP_EVT_TIMER_TIME,			//31		byte[0] 31: ����ʱ	          byte[1]:1����  2��ͣ 0�ر�
    DSP_EVT_SYNC_HERAT_BLOOD_OXYGEN,//32 byte[0] 32: ͬ��byte[1]:1���� byte[2]����ֵ    ͬ��byte[1]:2Ѫѹbyte[2]��ѹbyte[3]��ѹ	ͬ��byte[1]:3Ѫ��byte[2]Ѫ��ֵ ��APP
    DSP_EVT_SELECT_WATCH_INDEX,//33	byte[0] 33: �ֻ������л�����
    DSP_EVT_SYSTEM_SIRI,		//34		byte[0] 34: ��������
    DSP_EVT_BT_SWATCH,			//35		byte[0] 35: ����������Ƶ�������� ��byte[1] 1��������Ƶ����  0���ر���Ƶ����


    //enzon
    DSP_EVT_LOAD_PHONE_BOOK,
    DSP_EVT_BT_A2DP_CONTROL,
    DSP_EVT_MUSIC_CONTROL,
    DSP_EVT_CALL_CONTROL,
    DSP_EVT_BT_VALUME_UP,
    DSP_EVT_BT_VALUME_DOWN,
    DSP_EVT_READ_MSG_LIST,
    DSP_EVT_READ_PHONE_BOOK_LIST,
    DSP_EVT_READ_CALL_NAME,

}_DSP_COMMADE_T;

extern lv_point_t sys_scroll_sum;


typedef		struct
{
    uint16_t	ucYear;
    uint8_t		ucMonth;
    uint8_t		ucDate;
    uint8_t		ucHour;
    uint8_t		ucMinute;
    uint8_t		ucSecond;
}stTime_type;




#define  CALL_NUMBER_MAX_LEN    32
#define CALL_RECORD_LIST_MAX    10

typedef struct
{
    uint8_t call_state;
    uint8_t number_len;
    uint8_t call_number[CALL_NUMBER_MAX_LEN - 2];

} card_record_t;


#define  MAX_MSG_LIST   5

typedef struct
{
    uint8_t call_record_total;
    card_record_t fifo[CALL_RECORD_LIST_MAX];
} call_record_list_t;

#endif




extern void lv_guimain(lv_obj_t* obj);
extern void ui_main_float(lv_obj_t* parent);
extern void layer_main_cont(lv_obj_t* parent, ui_entry f_cont, ui_entry f_cont1);
extern void layer_left_cont(lv_obj_t* parent, ui_entry f_cont, ui_entry f_cont1);


extern void lv_app_starsky_btn(lv_obj_t* parent);
extern void lv_app_mainmenu_up(lv_obj_t* parent);
extern void lv_app_system_setting(lv_obj_t* parent);
extern void lv_app_backlight_setting(lv_obj_t* parent);
extern void lv_app_clock_ui_select(lv_obj_t* obj);
extern void lv_app_lock(lv_obj_t* parent);
extern void lv_app_powerdown(lv_obj_t* parent);
extern void lv_app_lighting(lv_obj_t* parent);
extern void lv_app_ota_ui(lv_obj_t* parent);
extern void lv_app_phone_call(lv_obj_t* obj);
extern void lv_app_calendar(lv_obj_t* obj);
extern void lv_app_msg_win(lv_obj_t* obj);
extern void lv_sport_detail_disp(lv_obj_t* parent);
extern void lv_app_music_menu(lv_obj_t* parent);


extern uint32_t CalcWeekday(stTime_type time);
extern void topbar_status_bt_baterrry_time(lv_obj_t* bar_bat, lv_obj_t* bar_time);




//---setting function


typedef enum
{
    UI_MAIN_FLOAT = 0,
    UI_APP_START_SKY,
    UI_APP_OTA,
    UI_APP_INCOMING,
    UI_APP_MSG_FLOAT,
    UI_APP_SPORT_DETAIL,
    UI_APP_MUSIC,





    UI_APP_UI_MAX,

}ui_type_t;



extern LV_ATTRIBUTE_LARGE_CONST const pri_ui_entry style_func_arry[];

extern uint8_t call_context[200];
extern uint8_t call_list[200];
extern uint8_t book_list[10][200];
extern call_record_list_t record_list;

//do op & data interface here!
//op
//

extern ui_info_t ui_info;

#define  UI_LAYER_ACTIVE_TAG    0x80
//layer_page
//    page = (UI_lAYER1_lEVEL_TAG | page_id)
void dsp_store_ui_scene(uint8_t mode, uint8_t layer, uint8_t page, uint16_t page_cur_x, uint16_t page_cur_y);
void dsp_set_ui_scene_default_style(uint8_t type);
uint8_t dsp_get_ui_scene_default_style(void);
uint8_t dsp_get_ui_scene_mode(void);
uint8_t dsp_get_ui_scene_prev_mode(void);
uint8_t dsp_get_ui_scene_layer(void);
uint8_t dsp_get_ui_scene_page_by_layer(uint8_t layer);
uint16_t dsp_get_ui_scene_cur_x(void);
uint16_t dsp_get_ui_scene_cur_y(void);


void dsp_turn_on_ble(void);
void dsp_turn_off_ble(void);
void dsp_turn_on_bt(void);
void dsp_turn_off_bt(void);
void dsp_op_system_shut_down(void);
void dsp_op_system_reset(void);
void dsp_op_system_reboot(void);

void dsp_op_system_music_play(void);
void dsp_op_system_music_stop(void);
void dsp_op_system_music_prev(void);
void dsp_op_system_music_next(void);

void dsp_op_system_call_out(uint8_t* number, uint8_t len);

void dsp_op_get_current_call(call_info_t* call);
void dsp_op_get_call_from_story(call_info_t* call, uint16_t id);
void dsp_op_get_call_from_book(call_info_t* call, uint16_t id);
void dsp_op_sync_phone_book(void);
uint16_t dsp_op_get_phone_book_id_offset(void);
uint16_t dsp_op_set_phone_book_id_offset(uint16_t id_offset);
void dsp_op_system_call_ok(void);
void dsp_op_system_call_reject(void);
void dsp_op_read_cm3_record_list(void);
void dsp_op_get_call_from_record_list(call_info_t* call, uint8_t* call_context);
//void dsp_op_get_call_from_record_list(call_info_t *call, uint8_t *number, uint8_t number_len);
uint8_t dsp_get_system_record_total(void);

void dsp_op_sports_start(uint8_t mode);
void dsp_op_sports_stop(uint8_t mode);
void dsp_op_sports_pause(uint8_t mode);
void dsp_op_read_cm3_msg(void);
void dsp_op_system_timer_delay(uint16_t n);

void dsp_op_system_hrm_start(void);
void dsp_op_system_hrm_stop(void);
void dsp_post_operate_to_m3(uint8_t op_cmd, uint8_t* buffer, uint16_t len);


//data
uint16_t dsp_get_system_time_year(void);
uint8_t dsp_get_system_time_month(void);
uint8_t dsp_get_system_time_date(void);
uint8_t dsp_get_system_time_hour(void);
uint8_t dsp_get_system_time_minute(void);
uint8_t dsp_get_system_time_second(void);
uint8_t dsp_get_system_time_week(void);

uint8_t dsp_get_system_cm3_ver(void);
uint8_t dsp_get_system_dsp_ver(void);
uint8_t* dsp_get_system_mac_address(void);


void dsp_set_system_Wirst_Awake(uint8_t state);
uint8_t dsp_get_system_Wirst_Awake(void);
void dsp_set_system_no_disturb(uint8_t state);
uint8_t dsp_get_system_no_disturb(void);
void dsp_set_system_low_power(uint8_t state);
uint8_t dsp_get_system_low_power(void);
void dsp_set_system_panel_on_time(uint8_t value);
uint8_t dsp_get_system_panel_on_time(void);


void dsp_set_system_language(uint8_t id);
uint8_t dsp_get_system_language(void);
void dsp_set_system_backlight(uint8_t id);
uint8_t dsp_get_system_backlight(void);
void dsp_set_system_watch_face(uint8_t id);
uint8_t dsp_get_system_watch_face(void);
void dsp_set_system_menu_style(uint8_t id);
uint8_t dsp_get_system_menu_style(void);


void dsp_set_system_volume_media(uint8_t value);
uint8_t dsp_get_system_volume_media(void);
void dsp_set_system_volume_hfp(uint8_t value);
uint8_t dsp_get_system_volume_hfp(void);
void dsp_set_system_volume_tone(uint8_t value);
uint8_t dsp_get_system_volume_tone(void);
uint8_t* dsp_get_system_music_context(void);
uint8_t dsp_get_system_music_state(void);


uint8_t dsp_get_system_ble_state(void);
uint8_t dsp_get_system_ble_on_off(void);
uint8_t dsp_get_system_bt_on_off(void);
uint8_t dsp_get_system_bt_state(void);
uint8_t dsp_get_system_battery_state(void);
uint8_t dsp_get_system_battery_value(void);
uint8_t dsp_get_system_panel_state(void);
uint32_t dsp_get_system_step(void);
uint32_t dsp_get_system_calorie(void);
uint32_t dsp_get_system_distance(void);
uint8_t dsp_get_system_hrm(void);
void  dsp_clear_system_hrm(void);
uint8_t dsp_get_system_hrm_warning_h(void);
uint8_t dsp_get_system_hrm_warning_l(void);
uint8_t dsp_get_system_o2_sbp(void);
uint8_t dsp_get_system_o2_dbp(void);
uint8_t dsp_get_system_o2_spo2(void);
uint8_t dsp_get_system_blood_h(void);
uint8_t dsp_get_system_blood_l(void);
uint8_t* dsp_get_system_hrm_distory(void);
uint8_t* dsp_get_system_sleep_distory(void);
uint16_t dsp_get_system_sleep_total_time(void);
uint16_t dsp_get_system_sleep_d_time(void);
uint16_t dsp_get_system_sleep_l_time(void);


uint8_t dsp_get_system_msg_total(void);
void dsp_get_system_msg_time(uint8_t msg_id, uint8_t* buffer);
uint8_t dsp_get_system_msg_type(uint8_t msg_id);
void dsp_get_system_msg_title(uint8_t msg_id, uint8_t* buffer);
void dsp_get_system_msg_context(uint8_t msg_id, uint8_t* buffer);


uint8_t dsp_get_system_day1_weather_type(void);
int16_t dsp_get_system_day1_weather_temp(void);
int16_t dsp_get_system_day1_weather_temp_m(void);
int16_t dsp_get_system_day1_weather_temp_n(void);

uint8_t dsp_get_system_day2_weather_type(void);
int16_t dsp_get_system_day2_weather_temp(void);
int16_t dsp_get_system_day2_weather_temp_m(void);
int16_t dsp_get_system_day2_weather_temp_n(void);

uint8_t dsp_get_system_day3_weather_type(void);
int16_t dsp_get_system_day3_weather_temp(void);
int16_t dsp_get_system_day3_weather_temp_m(void);
int16_t dsp_get_system_day3_weather_temp_n(void);
//------------new add
uint16_t dsp_get_system_sleep_time(void);
uint32_t dsp_get_system_sport_time(void);
uint8_t dsp_get_system_sport_type(void);
uint16_t dsp_get_system_sport_speed(void);
uint16_t dsp_get_system_sport_step(void);
uint16_t dsp_get_system_sport_carlorie(void);
uint16_t dsp_get_system_sport_distcace(void);
uint8_t dsp_get_system_sport_state(void);
uint8_t dsp_get_system_sport_hrm(void);
uint8_t dsp_get_system_sport_hrm_max(void);
uint8_t dsp_get_system_sport_hrm_min(void);
uint8_t dsp_get_system_sport_oxygen(void);

uint8_t dsp_get_system_panel_show_time(void);
uint8_t dsp_set_system_panel_show_time(uint8_t time);


extern const lv_font_t arialuni_48;
extern const lv_font_t arialuni_32;
extern const lv_font_t arialuni_36;
extern const lv_font_t arialuni_20;
extern const lv_font_t arialuni_14;
extern const lv_font_t arialuni_120;
extern const lv_font_t arialuni_bpp2_20;

#define  FONT_BIN_ARIALUNI_20	&arialuni_bpp2_20 	//arialuni_20



static inline lv_color_t lv_color_red(void) { return lv_color_hex(0xF44336); }
static inline lv_color_t lv_color_red_lighten_5(void) { return lv_color_hex(0xFFEBEE); }
static inline lv_color_t lv_color_red_lighten_4(void) { return lv_color_hex(0xFFCDD2); }
static inline lv_color_t lv_color_red_lighten_3(void) { return lv_color_hex(0xEF9A9A); }
static inline lv_color_t lv_color_red_lighten_2(void) { return lv_color_hex(0xE57373); }
static inline lv_color_t lv_color_red_lighten_1(void) { return lv_color_hex(0xEF5350); }
static inline lv_color_t lv_color_red_darken_1(void) { return lv_color_hex(0xE53935); }
static inline lv_color_t lv_color_red_darken_2(void) { return lv_color_hex(0xD32F2F); }
static inline lv_color_t lv_color_red_darken_3(void) { return lv_color_hex(0xC62828); }
static inline lv_color_t lv_color_red_darken_4(void) { return lv_color_hex(0xB71C1C); }

static inline lv_color_t lv_color_pink(void) { return lv_color_hex(0xE91E63); }
static inline lv_color_t lv_color_pink_lighten_5(void) { return lv_color_hex(0xFCE4EC); }
static inline lv_color_t lv_color_pink_lighten_4(void) { return lv_color_hex(0xF8BBD0); }
static inline lv_color_t lv_color_pink_lighten_3(void) { return lv_color_hex(0xF48FB1); }
static inline lv_color_t lv_color_pink_lighten_2(void) { return lv_color_hex(0xF06292); }
static inline lv_color_t lv_color_pink_lighten_1(void) { return lv_color_hex(0xEC407A); }
static inline lv_color_t lv_color_pink_darken_1(void) { return lv_color_hex(0xD81B60); }
static inline lv_color_t lv_color_pink_darken_2(void) { return lv_color_hex(0xC2185B); }
static inline lv_color_t lv_color_pink_darken_3(void) { return lv_color_hex(0xAD1457); }
static inline lv_color_t lv_color_pink_darken_4(void) { return lv_color_hex(0x880E4F); }

static inline lv_color_t lv_color_purple(void) { return lv_color_hex(0x9C27B0); }
static inline lv_color_t lv_color_purple_lighten_5(void) { return lv_color_hex(0xF3E5F5); }
static inline lv_color_t lv_color_purple_lighten_4(void) { return lv_color_hex(0xE1BEE7); }
static inline lv_color_t lv_color_purple_lighten_3(void) { return lv_color_hex(0xCE93D8); }
static inline lv_color_t lv_color_purple_lighten_2(void) { return lv_color_hex(0xBA68C8); }
static inline lv_color_t lv_color_purple_lighten_1(void) { return lv_color_hex(0xAB47BC); }
static inline lv_color_t lv_color_purple_darken_1(void) { return lv_color_hex(0x8E24AA); }
static inline lv_color_t lv_color_purple_darken_2(void) { return lv_color_hex(0x7B1FA2); }
static inline lv_color_t lv_color_purple_darken_3(void) { return lv_color_hex(0x6A1B9A); }
static inline lv_color_t lv_color_purple_darken_4(void) { return lv_color_hex(0x4A148C); }

static inline lv_color_t lv_color_deep_purple(void) { return lv_color_hex(0x673AB7); }
static inline lv_color_t lv_color_deep_purple_lighten_5(void) { return lv_color_hex(0xEDE7F6); }
static inline lv_color_t lv_color_deep_purple_lighten_4(void) { return lv_color_hex(0xD1C4E9); }
static inline lv_color_t lv_color_deep_purple_lighten_3(void) { return lv_color_hex(0xB39DDB); }
static inline lv_color_t lv_color_deep_purple_lighten_2(void) { return lv_color_hex(0x9575CD); }
static inline lv_color_t lv_color_deep_purple_lighten_1(void) { return lv_color_hex(0x7E57C2); }
static inline lv_color_t lv_color_deep_purple_darken_1(void) { return lv_color_hex(0x5E35B1); }
static inline lv_color_t lv_color_deep_purple_darken_2(void) { return lv_color_hex(0x512DA8); }
static inline lv_color_t lv_color_deep_purple_darken_3(void) { return lv_color_hex(0x4527A0); }
static inline lv_color_t lv_color_deep_purple_darken_4(void) { return lv_color_hex(0x311B92); }

static inline lv_color_t lv_color_indigo(void) { return lv_color_hex(0x3F51B5); }
static inline lv_color_t lv_color_indigo_lighten_5(void) { return lv_color_hex(0xE8EAF6); }
static inline lv_color_t lv_color_indigo_lighten_4(void) { return lv_color_hex(0xC5CAE9); }
static inline lv_color_t lv_color_indigo_lighten_3(void) { return lv_color_hex(0x9FA8DA); }
static inline lv_color_t lv_color_indigo_lighten_2(void) { return lv_color_hex(0x7986CB); }
static inline lv_color_t lv_color_indigo_lighten_1(void) { return lv_color_hex(0x5C6BC0); }
static inline lv_color_t lv_color_indigo_darken_1(void) { return lv_color_hex(0x3949AB); }
static inline lv_color_t lv_color_indigo_darken_2(void) { return lv_color_hex(0x303F9F); }
static inline lv_color_t lv_color_indigo_darken_3(void) { return lv_color_hex(0x283593); }
static inline lv_color_t lv_color_indigo_darken_4(void) { return lv_color_hex(0x1A237E); }

static inline lv_color_t lv_color_blue(void) { return lv_color_hex(0x2196F3); }
static inline lv_color_t lv_color_blue_lighten_5(void) { return lv_color_hex(0xE3F2FD); }
static inline lv_color_t lv_color_blue_lighten_4(void) { return lv_color_hex(0xBBDEFB); }
static inline lv_color_t lv_color_blue_lighten_3(void) { return lv_color_hex(0x90CAF9); }
static inline lv_color_t lv_color_blue_lighten_2(void) { return lv_color_hex(0x64B5F6); }
static inline lv_color_t lv_color_blue_lighten_1(void) { return lv_color_hex(0x42A5F5); }
static inline lv_color_t lv_color_blue_darken_1(void) { return lv_color_hex(0x1E88E5); }
static inline lv_color_t lv_color_blue_darken_2(void) { return lv_color_hex(0x1976D2); }
static inline lv_color_t lv_color_blue_darken_3(void) { return lv_color_hex(0x1565C0); }
static inline lv_color_t lv_color_blue_darken_4(void) { return lv_color_hex(0x0D47A1); }

static inline lv_color_t lv_color_light_blue(void) { return lv_color_hex(0x03A9F4); }
static inline lv_color_t lv_color_light_blue_lighten_5(void) { return lv_color_hex(0xE1F5FE); }
static inline lv_color_t lv_color_light_blue_lighten_4(void) { return lv_color_hex(0xB3E5FC); }
static inline lv_color_t lv_color_light_blue_lighten_3(void) { return lv_color_hex(0x81D4FA); }
static inline lv_color_t lv_color_light_blue_lighten_2(void) { return lv_color_hex(0x4FC3F7); }
static inline lv_color_t lv_color_light_blue_lighten_1(void) { return lv_color_hex(0x29B6F6); }
static inline lv_color_t lv_color_light_blue_darken_1(void) { return lv_color_hex(0x039BE5); }
static inline lv_color_t lv_color_light_blue_darken_2(void) { return lv_color_hex(0x0288D1); }
static inline lv_color_t lv_color_light_blue_darken_3(void) { return lv_color_hex(0x0277BD); }
static inline lv_color_t lv_color_light_blue_darken_4(void) { return lv_color_hex(0x01579B); }

static inline lv_color_t lv_color_cyan(void) { return lv_color_hex(0x00BCD4); }
static inline lv_color_t lv_color_cyan_lighten_5(void) { return lv_color_hex(0xE0F7FA); }
static inline lv_color_t lv_color_cyan_lighten_4(void) { return lv_color_hex(0xB2EBF2); }
static inline lv_color_t lv_color_cyan_lighten_3(void) { return lv_color_hex(0x80DEEA); }
static inline lv_color_t lv_color_cyan_lighten_2(void) { return lv_color_hex(0x4DD0E1); }
static inline lv_color_t lv_color_cyan_lighten_1(void) { return lv_color_hex(0x26C6DA); }
static inline lv_color_t lv_color_cyan_darken_1(void) { return lv_color_hex(0x00ACC1); }
static inline lv_color_t lv_color_cyan_darken_2(void) { return lv_color_hex(0x0097A7); }
static inline lv_color_t lv_color_cyan_darken_3(void) { return lv_color_hex(0x00838F); }
static inline lv_color_t lv_color_cyan_darken_4(void) { return lv_color_hex(0x006064); }

static inline lv_color_t lv_color_teal(void) { return lv_color_hex(0x009688); }
static inline lv_color_t lv_color_teal_lighten_5(void) { return lv_color_hex(0xE0F2F1); }
static inline lv_color_t lv_color_teal_lighten_4(void) { return lv_color_hex(0xB2DFDB); }
static inline lv_color_t lv_color_teal_lighten_3(void) { return lv_color_hex(0x80CBC4); }
static inline lv_color_t lv_color_teal_lighten_2(void) { return lv_color_hex(0x4DB6AC); }
static inline lv_color_t lv_color_teal_lighten_1(void) { return lv_color_hex(0x26A69A); }
static inline lv_color_t lv_color_teal_darken_1(void) { return lv_color_hex(0x00897B); }
static inline lv_color_t lv_color_teal_darken_2(void) { return lv_color_hex(0x00796B); }
static inline lv_color_t lv_color_teal_darken_3(void) { return lv_color_hex(0x00695C); }
static inline lv_color_t lv_color_teal_darken_4(void) { return lv_color_hex(0x004D40); }

static inline lv_color_t lv_color_green(void) { return lv_color_hex(0x4CAF50); }
static inline lv_color_t lv_color_green_lighten_5(void) { return lv_color_hex(0xE8F5E9); }
static inline lv_color_t lv_color_green_lighten_4(void) { return lv_color_hex(0xC8E6C9); }
static inline lv_color_t lv_color_green_lighten_3(void) { return lv_color_hex(0xA5D6A7); }
static inline lv_color_t lv_color_green_lighten_2(void) { return lv_color_hex(0x81C784); }
static inline lv_color_t lv_color_green_lighten_1(void) { return lv_color_hex(0x66BB6A); }
static inline lv_color_t lv_color_green_darken_1(void) { return lv_color_hex(0x43A047); }
static inline lv_color_t lv_color_green_darken_2(void) { return lv_color_hex(0x388E3C); }
static inline lv_color_t lv_color_green_darken_3(void) { return lv_color_hex(0x2E7D32); }
static inline lv_color_t lv_color_green_darken_4(void) { return lv_color_hex(0x1B5E20); }

static inline lv_color_t lv_color_light_green(void) { return lv_color_hex(0x8BC34A); }
static inline lv_color_t lv_color_light_green_lighten_5(void) { return lv_color_hex(0xF1F8E9); }
static inline lv_color_t lv_color_light_green_lighten_4(void) { return lv_color_hex(0xDCEDC8); }
static inline lv_color_t lv_color_light_green_lighten_3(void) { return lv_color_hex(0xC5E1A5); }
static inline lv_color_t lv_color_light_green_lighten_2(void) { return lv_color_hex(0xAED581); }
static inline lv_color_t lv_color_light_green_lighten_1(void) { return lv_color_hex(0x9CCC65); }
static inline lv_color_t lv_color_light_green_darken_1(void) { return lv_color_hex(0x7CB342); }
static inline lv_color_t lv_color_light_green_darken_2(void) { return lv_color_hex(0x689F38); }
static inline lv_color_t lv_color_light_green_darken_3(void) { return lv_color_hex(0x558B2F); }
static inline lv_color_t lv_color_light_green_darken_4(void) { return lv_color_hex(0x33691E); }

static inline lv_color_t lv_color_lime(void) { return lv_color_hex(0xCDDC39); }
static inline lv_color_t lv_color_lime_lighten_5(void) { return lv_color_hex(0xF9FBE7); }
static inline lv_color_t lv_color_lime_lighten_4(void) { return lv_color_hex(0xF0F4C3); }
static inline lv_color_t lv_color_lime_lighten_3(void) { return lv_color_hex(0xE6EE9C); }
static inline lv_color_t lv_color_lime_lighten_2(void) { return lv_color_hex(0xDCE775); }
static inline lv_color_t lv_color_lime_lighten_1(void) { return lv_color_hex(0xD4E157); }
static inline lv_color_t lv_color_lime_darken_1(void) { return lv_color_hex(0xC0CA33); }
static inline lv_color_t lv_color_lime_darken_2(void) { return lv_color_hex(0xAFB42B); }
static inline lv_color_t lv_color_lime_darken_3(void) { return lv_color_hex(0x9E9D24); }
static inline lv_color_t lv_color_lime_darken_4(void) { return lv_color_hex(0x827717); }

static inline lv_color_t lv_color_yellow(void) { return lv_color_hex(0xFFEB3B); }
static inline lv_color_t lv_color_yellow_lighten_5(void) { return lv_color_hex(0xFFFDE7); }
static inline lv_color_t lv_color_yellow_lighten_4(void) { return lv_color_hex(0xFFF9C4); }
static inline lv_color_t lv_color_yellow_lighten_3(void) { return lv_color_hex(0xFFF59D); }
static inline lv_color_t lv_color_yellow_lighten_2(void) { return lv_color_hex(0xFFF176); }
static inline lv_color_t lv_color_yellow_lighten_1(void) { return lv_color_hex(0xFFEE58); }
static inline lv_color_t lv_color_yellow_darken_1(void) { return lv_color_hex(0xFDD835); }
static inline lv_color_t lv_color_yellow_darken_2(void) { return lv_color_hex(0xFBC02D); }
static inline lv_color_t lv_color_yellow_darken_3(void) { return lv_color_hex(0xF9A825); }
static inline lv_color_t lv_color_yellow_darken_4(void) { return lv_color_hex(0xF57F17); }

static inline lv_color_t lv_color_amber(void) { return lv_color_hex(0xFFC107); }
static inline lv_color_t lv_color_amber_lighten_5(void) { return lv_color_hex(0xFFF8E1); }
static inline lv_color_t lv_color_amber_lighten_4(void) { return lv_color_hex(0xFFECB3); }
static inline lv_color_t lv_color_amber_lighten_3(void) { return lv_color_hex(0xFFE082); }
static inline lv_color_t lv_color_amber_lighten_2(void) { return lv_color_hex(0xFFD54F); }
static inline lv_color_t lv_color_amber_lighten_1(void) { return lv_color_hex(0xFFCA28); }
static inline lv_color_t lv_color_amber_darken_1(void) { return lv_color_hex(0xFFB300); }
static inline lv_color_t lv_color_amber_darken_2(void) { return lv_color_hex(0xFFA000); }
static inline lv_color_t lv_color_amber_darken_3(void) { return lv_color_hex(0xFF8F00); }
static inline lv_color_t lv_color_amber_darken_4(void) { return lv_color_hex(0xFF6F00); }

static inline lv_color_t lv_color_orange(void) { return lv_color_hex(0xFF9800); }
static inline lv_color_t lv_color_orange_lighten_5(void) { return lv_color_hex(0xFFF3E0); }
static inline lv_color_t lv_color_orange_lighten_4(void) { return lv_color_hex(0xFFE0B2); }
static inline lv_color_t lv_color_orange_lighten_3(void) { return lv_color_hex(0xFFCC80); }
static inline lv_color_t lv_color_orange_lighten_2(void) { return lv_color_hex(0xFFB74D); }
static inline lv_color_t lv_color_orange_lighten_1(void) { return lv_color_hex(0xFFA726); }
static inline lv_color_t lv_color_orange_darken_1(void) { return lv_color_hex(0xFB8C00); }
static inline lv_color_t lv_color_orange_darken_2(void) { return lv_color_hex(0xF57C00); }
static inline lv_color_t lv_color_orange_darken_3(void) { return lv_color_hex(0xEF6C00); }
static inline lv_color_t lv_color_orange_darken_4(void) { return lv_color_hex(0xE65100); }

static inline lv_color_t lv_color_deep_orange(void) { return lv_color_hex(0xFF5722); }
static inline lv_color_t lv_color_deep_orange_lighten_5(void) { return lv_color_hex(0xFBE9E7); }
static inline lv_color_t lv_color_deep_orange_lighten_4(void) { return lv_color_hex(0xFFCCBC); }
static inline lv_color_t lv_color_deep_orange_lighten_3(void) { return lv_color_hex(0xFFAB91); }
static inline lv_color_t lv_color_deep_orange_lighten_2(void) { return lv_color_hex(0xFF8A65); }
static inline lv_color_t lv_color_deep_orange_lighten_1(void) { return lv_color_hex(0xFF7043); }
static inline lv_color_t lv_color_deep_orange_darken_1(void) { return lv_color_hex(0xF4511E); }
static inline lv_color_t lv_color_deep_orange_darken_2(void) { return lv_color_hex(0xE64A19); }
static inline lv_color_t lv_color_deep_orange_darken_3(void) { return lv_color_hex(0xD84315); }
static inline lv_color_t lv_color_deep_orange_darken_4(void) { return lv_color_hex(0xBF360C); }

static inline lv_color_t lv_color_brown(void) { return lv_color_hex(0x795548); }
static inline lv_color_t lv_color_brown_lighten_5(void) { return lv_color_hex(0xEFEBE9); }
static inline lv_color_t lv_color_brown_lighten_4(void) { return lv_color_hex(0xD7CCC8); }
static inline lv_color_t lv_color_brown_lighten_3(void) { return lv_color_hex(0xBCAAA4); }
static inline lv_color_t lv_color_brown_lighten_2(void) { return lv_color_hex(0xA1887F); }
static inline lv_color_t lv_color_brown_lighten_1(void) { return lv_color_hex(0x8D6E63); }
static inline lv_color_t lv_color_brown_darken_1(void) { return lv_color_hex(0x6D4C41); }
static inline lv_color_t lv_color_brown_darken_2(void) { return lv_color_hex(0x5D4037); }
static inline lv_color_t lv_color_brown_darken_3(void) { return lv_color_hex(0x4E342E); }
static inline lv_color_t lv_color_brown_darken_4(void) { return lv_color_hex(0x3E2723); }

static inline lv_color_t lv_color_blue_grey(void) { return lv_color_hex(0x607D8B); }
static inline lv_color_t lv_color_blue_grey_lighten_5(void) { return lv_color_hex(0xECEFF1); }
static inline lv_color_t lv_color_blue_grey_lighten_4(void) { return lv_color_hex(0xCFD8DC); }
static inline lv_color_t lv_color_blue_grey_lighten_3(void) { return lv_color_hex(0xB0BEC5); }
static inline lv_color_t lv_color_blue_grey_lighten_2(void) { return lv_color_hex(0x90A4AE); }
static inline lv_color_t lv_color_blue_grey_lighten_1(void) { return lv_color_hex(0x78909C); }
static inline lv_color_t lv_color_blue_grey_darken_1(void) { return lv_color_hex(0x546E7A); }
static inline lv_color_t lv_color_blue_grey_darken_2(void) { return lv_color_hex(0x455A64); }
static inline lv_color_t lv_color_blue_grey_darken_3(void) { return lv_color_hex(0x37474F); }
static inline lv_color_t lv_color_blue_grey_darken_4(void) { return lv_color_hex(0x263238); }

static inline lv_color_t lv_color_grey(void) { return lv_color_hex(0x9E9E9E); }
static inline lv_color_t lv_color_grey_lighten_5(void) { return lv_color_hex(0xFAFAFA); }
static inline lv_color_t lv_color_grey_lighten_4(void) { return lv_color_hex(0xF5F5F5); }
static inline lv_color_t lv_color_grey_lighten_3(void) { return lv_color_hex(0xEEEEEE); }
static inline lv_color_t lv_color_grey_lighten_2(void) { return lv_color_hex(0xE0E0E0); }
static inline lv_color_t lv_color_grey_lighten_1(void) { return lv_color_hex(0xBDBDBD); }
static inline lv_color_t lv_color_grey_darken_1(void) { return lv_color_hex(0x757575); }
static inline lv_color_t lv_color_grey_darken_2(void) { return lv_color_hex(0x616161); }
static inline lv_color_t lv_color_grey_darken_3(void) { return lv_color_hex(0x424242); }
static inline lv_color_t lv_color_grey_darken_4(void) { return lv_color_hex(0x212121); }


lv_color_t lv_palette_lighten(lv_palette_t p, uint8_t lvl);
lv_color_t lv_palette_darken(lv_palette_t p, uint8_t lvl);

void init_system_time(void);

#ifdef __cplusplus
} /* extern "C" */
#endif
#endif
